from django.core.mail import send_mail
from django.conf import settings
from main import celery_app


@celery_app.task()
def send_mail_celery(title, content, to_mail):
    print('发送邮件任务')
    print(title)
    print(content)
    print(to_mail)
    res = send_mail(title, content, settings.EMAIL_FROM, [to_mail])
    print(res)
    return res


# from django.core.mail import send_mail
#
# from django.conf import settings
# from main import celery_app
#
#
# @celery_app.task()
# def send_mail_celery(title,content,to_mail):
#     send_mail(title,content,settings.EMAIL_FROM,[to_mail])








